
package com.cmc.service.impl;

import java.util.List;

import com.cmc.service.impl.BaseManager;
import com.cmc.model.Department;
import com.cmc.dao.DepartmentDao;
import com.cmc.service.DepartmentManager;
/*
* @aegis.mapping
*/
public class DepartmentManagerImpl extends BaseManager implements DepartmentManager {
    private DepartmentDao dao;

    /**
     * Set the Dao for communication with the data layer.
     * @param dao
     */
    public void setDepartmentDao(DepartmentDao dao) {
        this.dao = dao;
    }

    /**
     * @see com.cmc.service.DepartmentManager#getDepartments(com.cmc.model.Department)
     */
    public List getDepartments(final Department department) {
        return dao.getDepartments(department);
    }

    /**
     * @see com.cmc.service.DepartmentManager#getDepartment(String id)
     */
    public Department getDepartment(final String id) {
        return dao.getDepartment(new Long(id));
    }

    /**
     * @see com.cmc.service.DepartmentManager#saveDepartment(Department department)
     */
    public void saveDepartment(Department department) {
        dao.saveDepartment(department);
    }

    /**
     * @see com.cmc.service.DepartmentManager#removeDepartment(String id)
     */
    public void removeDepartment(final String id) {
        dao.removeDepartment(new Long(id));
    }
}
